<div class="row-content am-cf">
	<div class="row">
		<div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
			<div class="widget am-cf">
				<div class="widget-head am-cf">
					<div class="widget-title am-fl">编辑分类</div>
					<div class="widget-function am-fr">
						<a href="javascript:;" class="am-icon-cog"></a>
					</div>
				</div>
				<div class="widget-body am-fr">
					<form class="am-form tpl-form-line-form" id="dataForm" method="post" >
						<input type="hidden" id="id"  name="id" th:value="${record.id}"/> 
						<div class="am-form-group">
							<label for="type" class="am-u-sm-2 am-form-label">所属部门</label>
							<div class="am-u-sm-10">
								<select id="depart" class="tpl-form-input" placeholder="请输入部门" name="depart" >
									<option value="1" th:selected="${record.depart== 1 }">产业一部</option>
									<option value="2" th:selected="${record.depart== 2 }">产业二部</option>
									<option value="3" th:selected="${record.depart== 3 }">产业三部</option>									
								</select> 
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="type" class="am-u-sm-2 am-form-label">分类名称</label>
							<div class="am-u-sm-10">
								<input type="text" id="type" class="tpl-form-input" placeholder="请输入分类名称" name="type" th:value="${record.type}"/> 
							</div>
						</div>
						
						<div class="am-form-group">
							<label for="type" class="am-u-sm-2 am-form-label">排序</label>
							<div class="am-u-sm-10">
								<input type="text" id="sort" class="tpl-form-input" placeholder="请输入序号" name="sort" th:value="${record.sort}"/> 
							</div>
						</div>
						<div class="am-form-group">
							<div class="am-u-sm-10 am-u-sm-push-2">
								
								<button type="button" onclick="javascript:$('#dataForm').submit();"
									class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
										<button type="button" onclick="loadPage('type/listUI')"
									class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>

	</div>
	<script th:inline="javascript">
	<![CDATA[
		validateDataForm();
		function validateDataForm(){ 
			$('#dataForm').validate({
		        errorElement : 'span',
		        errorClass : 'am-icon-times',
		        focusInvalid : true,
		        onkeyup:false,
		        ignore : "",
		        rules : {
		        	type : {
		                required : true
		            }
		        },
		        messages : {
		        	type : {
		                required : "请填写分类名称"
		            }
		        },
		        submitHandler : function(form) {
		        	commit('dataForm', 'type/save', 'type/listUI');
		        }
		    });
		}
		
		]]>
	</script>